package leetcode_2401_2500;

public class LeeCode_2446 {
    public static void main(String[] args) {
        System.out.println(haveConflict(new String[]{"10:13", "13:02"}, new String[]{"13:17", "21:38"}));
    }
    private static boolean haveConflict(String[] event1, String[] event2) {
        int s1 = getTime(event1[0]);
        int e1 = getTime(event1[1]);
        int s2 = getTime(event2[0]);
        int e2 = getTime(event2[1]);
        return !(e1 < s2 || e2 < s1);
    }
    private static int getTime(String time){
        String[] split = time.split(":");
        int hour = Integer.parseInt(split[0]);
        int mint = Integer.parseInt(split[1]);
        return hour * 60 + mint;
    }
}
